home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000175_icon-group-sender _Tue Aug 3 16:45:48 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id QAA22281
  4.     for icon-group-addresses; Tue, 3 Aug 1999 16:41:17 -0700 (MST)
  5. Message-Id: <199908032341.QAA22281@baskerville.CS.Arizona.EDU>
  6. X-Sender: memphis@popmail.macconnect.com
  7. Date: Tue, 3 Aug 1999 15:08:17 -0500
  8. To: gep2@terabites.com, icon-group@optima.CS.Arizona.EDU
  9. From: Garry <memphis@macconnect.com>
  10. Subject: Learning by Example (was:  When Do You Keep A Quirk?)
  11. X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id NAA09706
  12. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  13. Status: RO
  14.  
  15. Gordon Peterson wrote:
  16. >The fact, as Richard points out, that Unix systems aren't even consistent within 
  17. >themselves gives even one more reason to not worry about trying to recreate the 
  18. >mythical "standard" basename()'s routine's anachronistic behavior.
  19. >
  20. >His suggestions for new routines (which would hopefully be even more useful and 
  21. >practical) sound fine, and I'm sure would be appreciated by many programmers.
  22. >
  23. >The idea, though, that we have to retire the generic function name "basename" 
  24. >for all time still strikes me as being pretty ridiculous.
  25. >
  26. >Again, don't people understand that a lot of the routines in IPL are there 
  27. >principally AS EXAMPLES!!!???  
  28.  
  29. The IPL has quite a large number of good examples, as Gordon has pointed out (some of the IPL code I don't understand yet but I'm making good progress on my first set of programs, for maintaining my programming notes and extracting reports from them -- stuff that I used to with big ugly shell scripts).  Personally I can't imagine blindly incorporating anything from any library into my work without at least considering checking out (I keep everything under version control using MPW Projector) a branch version that I will modify for the specific needs of the project.  That's why I was looking at the implementation of Basename in the first place; I was considering whether it was suitable as a replacement for my own quirky (accepts regex for the suffix) implementation of Basename in a current project.
  30.  
  31. As a newbie I can tell you that I have found three great resources for learning Icon:
  32. 1) The Icon Programming Language by Griswold and Griswold.  This book is worth every penny; it is a labor of love and has obviously been honed and polished to explain the Deep Concepts of Icon in crystal clear fashion.
  33. 2) The Icon Programming Language Handbook by Thomas W. Christopher.  A gem of almost-mathematical precision. Explains some idioms and gives a viewpoint that complements the Griswold book.  This is a "must have" and that's not a problem because it's FREE.  <http://www.iit.edu/~tc/iconplh.htm>  This handbook has lots of very helpful examples.  Some problems are solved repeatedly using different techniques to show how you would do it using the different features of Icon.
  34. 3) The IPL.  May be easy to overlook as a teaching resource because it is so large.  It would be almost impossible to read all of the good stuff in the Icon Library.  Don't neglect reading some of the Library just because you can't read all of the library.  (Some of it is discouraging to newbies because it is incomprehensible even after a once-through reading of the Griswold book.  Man! You can do some wild things with Icon. ) 
  35.  
  36. The golden rule to writing Icon seems to be "tell what you want to do".  I could write in a similar style in Forth, but then I had to invent all of the constructs that I used.  Icon, as William Mitchell says, "provides a great set of abstract data types right out of the box."  An example of "telling what you want to do" occured last night when I wanted to step through a file to the first line that starts with a section mark character (some of you can see the character here: ∩┐╜)  I had the darndest time until I wrote simply
  37.     if not while line := read( file ) do
  38.         if match( "∩┐╜ ", line) then break then fail
  39. which is close to a direct statement of what I was trying to do and was possible because Icon, like Scheme, has only expressions, even "while e1 do e2" is an expression (that ultimately fails unless exited by a "break").
  40.  
  41.  
  42. --
  43.   Garry Roseman  <mailto:memphis@macconnect.com>
  44.   Tech Writer & Freelance Programmer
  45.  
  46.  
  47.